<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('活动签到')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-activitysign-add">
        	<input name="actId" th:value="${act.actId}" type="hidden">
            <div class="form-group">    
                <div class="col-sm-12">
                	<span>活动组织机构：</span><span th:text="${act.orgName}"></span>
                </div>
            </div>
            <div class="form-group">    
                <div class="col-sm-12">
                	<span>活动主题：</span><span th:text="${act.actSubject}"></span>
                </div>
            </div>
            <div class="form-group">    
                <div class="col-sm-12">
                	<span>活动时间：</span><span th:text="${act.actDate}"></span>
                </div>
            </div>
            <div class="form-group">    
                <div class="col-sm-12">
                	<span>起止时间：</span><span th:text="${act.actDateRange}"></span>
                </div>
            </div>
            <div class="form-group">    
                <div class="col-sm-12">
                	<span>活动地址：</span><span th:text="${act.actAddr}"></span>
                </div>
            </div>
            <div class="form-group">    
                <div class="col-sm-12">
                    <input name="memberId" class="form-control" placeholder="请输入党员编号" type="text" maxlength="10" required>
                </div>
            </div>
            <div class="form-group">    
                <div class="col-sm-12">
                   <input type="button"  style="background-color: red;color:white;" class="form-control"  value="签到" onclick="submitHandler()"/>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "business/activitysign"
        $("#form-activitysign-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
            	$.ajax({
            		url:prefix + "/add",
            		type:'post',
            		dataType:'json',
            		data:$('#form-activitysign-add').serialize(),
            		success:function(res){
            			console.log(res);
            			if(res.code==0){
            				$.modal.alertSuccess("签到成功");
            			}else{
            				$.modal.alertError(res.msg);
            			}
            		},
            		error:function(err){
            			console.log("err="+err);
            		}
            	
            	});
                //$.operate.save(prefix + "/add", $('#form-activitysign-add').serialize());
            }
        }

       
    </script>
</body>
</html>